module.exports = app => {
    const { STRING, INTEGER, DATE, BIGINT, TINYINT } = app.Sequelize;

    const JobApplication = app.model.define('job_application', {
        application_id: {
            type: BIGINT.UNSIGNED,
            primaryKey: true,
            autoIncrement: true,
        },
        job_id: { type: BIGINT.UNSIGNED, allowNull: false },
        user_id: { type: BIGINT.UNSIGNED, allowNull: false },
        resume_id: { type: BIGINT.UNSIGNED, allowNull: false },
        status: { type: TINYINT, allowNull: true, defaultValue: 0 },
        applied_at: DATE,
    }, {
        tableName: 'job_applications',
        timestamps: false,
    });

    return JobApplication;
};